cody - HTMLify profile

cody
4270 Files
632713 Views
Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/04 - Digital Clock
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "sans";
}
@font-face {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "sans";
}
@font-face {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Digital Clock</title>
<link rel="stylesheet" href="style.css" />
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Digital Clock</title>
<link rel="stylesheet" href="style.css" />
const hour = document.getElementById("hour");
const minute = document.getElementById("minute");
const seconds = document.getElementById("seconds");
const ampm = document.getElementById("ampm");
// Add 0 to the begining of number if less than 10
function formatTime(time) {
return time.toString().padStart(2, "0");
const minute = document.getElementById("minute");
const seconds = document.getElementById("seconds");
const ampm = document.getElementById("ampm");
// Add 0 to the begining of number if less than 10
function formatTime(time) {
return time.toString().padStart(2, "0");